package cate.common.table.friendaid.sheet;

import cate.common.table.ESheet;
import cate.common.table.d.GDFunc;
import cate.common.table.friendaid.row.FriendAidBaseRow;

public class FriendAidBaseSheet extends ESheet<FriendAidBaseRow> {
    @Override
    public String getSheetName() {
        return "援助基础";
    }

    public FriendAidBaseRow getFuncRow(int funcId) {
        if (funcId >= GDFunc.DAILY_FB_FIRST && funcId <= GDFunc.DAILY_FB_END) {
            funcId = GDFunc.DAILY_FB;
        } else if (funcId >= GDFunc.FORBIDDEN_C1 && funcId <= GDFunc.FORBIDDEN_C6) {
            funcId = GDFunc.FORBIDDEN_ZONE;
        }
        final int finalFuncId = funcId;
        return getList().stream().filter(e -> e.funcId == finalFuncId).findAny().orElse(null);
    }
}
